package top.zhimingw.service;

import top.zhimingw.pojo.Comment;

import java.util.List;

/**
 * @ClassName: CommentService
 * @Description: (Comment)表服务接口
 * @Author:zhimingw
 * @Version 1.0
 * @since 2021/6/30 14:47
 */
public interface CommentService {
    
    /**
    * @Description: 添加一条评论
    * @Param: [comment]
    * @return: java.lang.Integer
    * @Author: zhimingw
    * @Date: 2021/7/7
    */
    boolean insert(Comment comment);
    
    /**
    * @Description: 根据文章ID和类型获取文章
    * @Param: [aId, type]
    * @return: java.util.List<top.zhimingw.pojo.Comment>
    * @Author: zhimingw
    * @Date: 2021/6/30
    */
    List<Comment> queryByArticleIdAndType(Integer aId,Integer type);
    
    /**
    * @Description: 获取评论的数量
    * @Param: []
    * @return: java.lang.Integer
    * @Author: zhimingw
    * @Date: 2021/7/5
    */
    Integer getCount();

    /**
    * @Description: 获取未读评论的数量
    * @Param: []
    * @return: java.lang.Integer
    * @Author: zhimingw
    * @Date: 2021/7/5
    */
    Integer getUnReadCount();
    
    /**
    * @Description: 实例对象
    * @Param: [comment]
    * @return: java.util.List<top.zhimingw.pojo.Comment>
    * @Author: zhimingw
    * @Date: 2021/7/6
    */
    List<Comment> queryAll(Comment comment);
    
    /**
    * @Description: 查询单条数据
    * @Param: [id]
    * @return: top.zhimingw.pojo.Comment
    * @Author: zhimingw
    * @Date: 2021/7/7
    */
    Comment queryById(Integer id);
    
    /**
    * @Description: 修改Comment,根据 comment 的主键修改数据
    * @Param: [comment]
    * @return: boolean
    * @Author: zhimingw
    * @Date: 2021/7/7
    */
    boolean update(Comment comment);
    
    /**
    * @Description: 通过文章id获取评论数量
    * @Param: [id]
    * @return: java.lang.Integer
    * @Author: zhimingw
    * @Date: 2021/7/7
    */
    Integer queryByArticleId(Integer id);
    
    /**
    * @Description: 删除Comment
    * @Param: [id]
    * @return: boolean
    * @Author: zhimingw
    * @Date: 2021/7/16
    */
    boolean deleteByArticle(Integer id);

    /**
    * @Description: 删除Comment
    * @Param: [id]
    * @return: boolean
    * @Author: zhimingw
    * @Date: 2021/7/20
    */
    boolean deleteById(Integer id);

    /**
    * @Description: 删除Comment
    * @Param: [id]
    * @return: boolean
    * @Author: zhimingw
    * @Date: 2021/7/20
    */
    boolean deleteByReplyId(Integer id);
}
